package module1;

public class wanshu_finder {

    public static void main(String[] args) {
        System.out.println("开始找出1000以内的完数");

        for (int i=0;i<1000; i++){
            if (isWanShu(i)){
                System.out.println(i);
            }
        }

    }

    public static boolean isWanShu(int number){
        int sum = 0;
        for (int i=1; i<= number/2; i++){
            if (number % i == 0) {
                sum+=i;
            }
        }

        if (sum==number)
            return true;
        else
            return false;
    }


}
